package com.situ.blog.listener;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.situ.blog.dao.IBlogDao;
import com.situ.blog.dao.impl.BlogDaoImpl;
import com.situ.blog.pojo.Blog;

public class BlogExcelListener extends AnalysisEventListener<Blog> {
    private IBlogDao blogDao = new BlogDaoImpl();

    @Override
    public void invoke(Blog blog, AnalysisContext analysisContext) {
        System.out.println("BlogExcelListener.invoke");
        System.out.println(blog);
        blogDao.addExcel(blog);
    }

    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {
        System.out.println("BlogExcelListener.doAfterAllAnalysed");
    }
}
